package com.cloud.mall.test.controller;

import com.cloud.mall.dto.test.Product;
import com.cloud.mall.result.GeneralResponse;
import com.cloud.mall.test.service.ProductTblService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 梁二东
 * @Date: 2024/12/16 10:37
 * @Description:
 **/
@RestController
@RequestMapping("/testproduct")
public class ProductTblController {

    @Autowired
    private ProductTblService productTblService;

    /**
     * 查询商品信息
     */
    @GetMapping("/selectByCommodityCode")
    public GeneralResponse<Product> selectByCommodityCode(@RequestParam("commodityCode") String commodityCode) {
        return GeneralResponse.success(productTblService.selectByCommodityCode(commodityCode));
    }
}
